#ifndef MYGRAPHICSVIEW_H
#define MYGRAPHICSVIEW_H

#include <QWidget>
#include<QGraphicsView>
class MyGraphicsView : public QGraphicsView
{
    Q_OBJECT
public:
    explicit MyGraphicsView(QWidget *parent = nullptr);
signals:
    void mouseDoubleClick(QMouseEvent *e);
    void mousePress(QMouseEvent *e);
    void mouseMove(QMouseEvent *e);
    void keyPress(QKeyEvent *e);
    void mouseRelease(QMouseEvent *e);

protected:
    void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;//双击鼠标画点
    void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;//右键画线，左键拖动图元
    void mouseMoveEvent(QMouseEvent * event) Q_DECL_OVERRIDE;
    void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
    void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE;

};

#endif // MYGRAPHICSVIEW_H
